<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false" %>
<%@ include file="/common/include.jsp"%>
<%@ page import="com.ekingstar.framework.security.UserUtil"%>

	<%
		String exp = request.getParameter("expired");
		String top = request.getParameter("top");
		String fullscreen = request.getParameter("fullscreen");
		if (top != null){
			out.println("<script>top.location='?expired';</script>");
			return;
		}
		if (fullscreen != null){
			
			out.println("<html><head><script type='text/javascript'>"
			
			+"window.open('/','','toolbar =no, menubar=no, scrollbars=no, location=no,resizable=yes,status=yes');"
			+"function closeSelf(){"
			+"window.open('','_self');"	
			+"window.opener=null;"	
			+"window.close();}"
			+"setTimeout(closeSelf,3000);"
			+"</script></head><body></body></html>");
			return;
		}
		boolean logged = UserUtil.isLogged();
		if (!logged ){
	%>
	
	
	
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="css/css.css" rel="stylesheet" type="text/css">
<title>ekingstar 高校决策支持系统</title>
<style type="text/css">
body{background:url(images/login_bg.jpg) repeat-x top #B9D0FF; text-align:center; margin:0px;
font-size:12px;}
div{ margin:0 auto;}
.login{background:url(images/login.jpg) no-repeat; width:808px; height:610px;}
.table {padding-top:480px; margin:0 auto;}
.table .text{ font-weight:bold; color:#003E8B; text-align:right;}
.loginInput{ border:1px solid #A0C5E5; background:#F4F4F4; height:16px;}
.loginBotton{ background:#003E8B; background:url(images/login_btn.jpg) no-repeat; color:#003E8B;font-weight:bold; border:0px; width:60px; height:28px}
.copyright{ font-family:Arial, Helvetica, sans-serif; padding-top:40px;}
a.msg:link,a.msg:visited{ text-decoration:none; color:#333;}
a.msg:hover{ text-decoration: underline; color:#f00;}
.error{padding-top:4px; color:red; width:95%;}
</style>
</head>
<body oncontextmenu="return false;" oncopy="return false;" onpaste="return false;" onselectstart="return false;" oncut="return false;">
<div class="login">
  <table width="90%" border="0" cellspacing="0" cellpadding="0" class="table">
  <form id="form" action='<s:url value="/j_acegi_cas_security_check"/>' method='post'>      
      <tr>
        <td class="text">用户名：</td>
        <td align="left"><input type="text" name="j_username" class="loginInput" value="<s:property value='#session.SPRING_SECURITY_LAST_USERNAME'/>"/></td>
        <td align="right" class="text">密码：</td>
        <td align="left"><input type="password" name="j_password" class="loginInput" /></td>
        <!--
        <td align="right" class="text">验证码：</td>
        <td align="left"><input name="imageCodeName" type="text" size="7" class="loginInput" /></td>
        <td><img width="64" height="24" src='<s:url value="/codeimage"/>' style="cursor: pointer; " onclick="this.src='<s:url value="/codeimage"/>?'+Math.floor(Math.random()*100)"/></td>
        -->
        <td align="left"><input type="submit" name="btn_submit" value="登录" class="loginBotton" onclick="location.href='default.html';"/></td>
        <td><a href="#" class="msg">忘记密码？</a></td>
      </tr>	      
    </form>
  </table>
<s:if test="#session.SPRING_SECURITY_LAST_EXCEPTION instanceof org.springframework.security.concurrent.ConcurrentLoginException">
	<div class="error">友情提示：<s:property value="#session.SPRING_SECURITY_LAST_USERNAME"/>已在别处登陆</div>
</s:if>
<s:elseif test="#session.SPRING_SECURITY_LAST_EXCEPTION instanceof com.ekingstar.framework.service.PwdErrorAuthenticationException">
	<div class="error">友情提示：${SPRING_SECURITY_LAST_EXCEPTION.message}</div>
</s:elseif>	
<s:elseif test="#session.SPRING_SECURITY_LAST_EXCEPTION instanceof org.springframework.security.AuthenticationException">
	<div class="error">友情提示：用户名或密码不正确</div>
</s:elseif>
<s:elseif test="#session.SPRING_SECURITY_LAST_EXCEPTION != null">
	<div class="error">友情提示：${SPRING_SECURITY_LAST_EXCEPTION.message}</div>
 </s:elseif>
<% if(exp != null){%>
	<div class="error">友情提示：你已被迫下线，或可能在其它地方上线</div>
<%} %>  
  <div class="copyright">版权所有2010&copy;ekingstar高校决策支持系统</div>
</div>
</body>

</html>
	
	<%}else {%>
		<html>
		<head>
		<title>ekingstar 高校决策支持系统</title>
		</head>
		<frameset rows="105,*,27" frameborder="no" border="0" framespacing="0" name="top" scrolling="yes" >
		
			<frame name="banner" src="index/top.jsp" scrolling="no" noresize="noresize" >
			
			<frameset border="0" frameSpacing="0" cols="6,*" MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0" name="forum" >
				<frame border="0" name="contents" marginWidth="0" marginHeight="0" src="index/leftframe.jsp" frameBorder="0" LEFTMARGIN="0" TOPMARGIN="0" noresize="noresize" >
				<frame border="0" name="main" borderColor="#FFFFFF" src="/hedss/welcome.jsp" frameBorder="no" noresize="noresize" >
			</frameset>
			
			<frame name="bottom" src="index/bottom.jsp" noResize scrolling="no" noresize>
			
		</frameset>
		</html>
	<%}%>